Hi all,
I have two question,First:Is how will data export to excel in datagridview.Second:
Is how will data import to database in excel.
Thanks in advance.
how will data export to excel in datagridview
9267
21-Sep-2011
Ely Sanders
22-Aug-2013Hi, here is an alternative and for me a more flexible and simplier way you can try to export DataGridView to Excel file in C#:
Also here is how you can import Excel file to a DataTable in C#:
I used this C# Excel component.
Anonymous User
03-Oct-2011You can use following link to export data from excel to data-grid view,
http://support.microsoft.com/kb/321686
Thanks,
James Smith
01-Oct-2011This is really good.
Can any one give me some example of datagridview demo in c#. So i can make a complete program on it.
Thanks,
John Smith
27-Sep-2011Amit Singh
27-Sep-2011Kenny Tangnde
25-Sep-2011Hi all,
thanks Awadhendra Tiwari,It helps me a lot.
Thanks.
Anonymous User
24-Sep-2011Anonymous User
24-Sep-2011You can take a look at following link for learning linq
http://msdn.microsoft.com/en-us/vcsharp/aa336766
http://geekswithblogs.net/elroydsilva/archive/2008/11/03/learning-linq---an-overview.aspx
http://www.linqlearning.com/sp/16295-LINQ-to-SQL-Tutorials-Learning-Resources/
Thanks.
Kenny Tangnde
23-Sep-2011hi Awadhendra Tiwari,Rohit Kesharwani,
Thank you for your help,Thanks Rohit Kesharwani . he helps me a lot.
again ask a question:
you can provide LINQ learning resources to me,and LINQ in project the integrated application.
Grateful.
John Smith
23-Sep-2011Uttam Misra
23-Sep-2011using System.Data.SqlClient;
Anonymous User
23-Sep-2011Anonymous User
23-Sep-2011You can make following modification on above code
using System.Data.SqlClient; //import this namespace at top
then replace OleDbCommand by SqlCommand class.
Then above code also work for you.
Thanks.
Kenny Tangnde
22-Sep-2011hi Rohit Kesharwani,
i not used using System.Data.OleDb; i want used using System.Data.SqlClient;
Thank you always help me, I hereby express my sincere thank you.
Chris Anderson
22-Sep-2011hi,
If you want that only checked rows will be exported then simply manipulate the above code:
Thanks.
Kenny Tangnde
22-Sep-2011hi Rohit Kesharwani,
Chris Anderson
22-Sep-2011Here are the solution of your both the problem:
Export Data from Excel in dataGridView:
Write the below code on the button click or on form load function:
Import Data from dataGridView in Excel:
Happy Coding.